var table;
var form;
layui.use('table', function(){
    table = layui.table
        ,form = layui.form;

    var url = "/activityDetails?uid=" + $.getUrlParam("uid");
    table.render({
        elem: '#test'
        ,url:url
        ,cellMinWidth: 80
        ,title: '统计'
        ,totalRow: true
        ,cols: [[
            {type:'numbers'}
            // ,{type: 'checkbox'}
            ,{field:'userNo',width:140, title:'编号'}
            ,{field:'orderNo',width:180, title:'订单号'}
            ,{field:'num',width:80, title:'件数'}
            ,{field:'time',title:'时间',templet :function (row){return createTime(row.time);}}
        ]]
        ,page: false
        ,id: 'test1'
    });

    function createTime(v){
        return new Date(parseInt(v)).toLocaleString()
    }
    /**重写toLocaleString方法*/
    Date.prototype.toLocaleString = function() {
        var y = this.getFullYear();
        var m = this.getMonth()+1;
        m = m<10?'0'+m:m;
        var d = this.getDate();
        d = d<10?("0"+d):d;
        var h = this.getHours();
        h = h<10?("0"+h):h;
        var M = this.getMinutes();
        M = M<10?("0"+M):M;
        var S=this.getSeconds();
        S=S<10?("0"+S):S;
        return y+"-"+m+"-"+d+" "+h+":"+M+":"+S;}

});